package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjQbMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjJcEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjQbEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjQbService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjQbService")
public class JcAjztTjQbServiceImpl extends ServiceImpl<JcAjztTjQbMapper, JcAjztTjQbEntity> implements JcAjztTjQbService {

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	@DS("oracle")
	public IPage<JcAjztTjQbEntity> infoPage(JcAjztTjQbEntity jcAjztTjQbEntity) {
		
		Page page = new Page(jcAjztTjQbEntity.getPage(), jcAjztTjQbEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjQbEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjQbEntity.getJcry())){
			queryWrapper.eq(JcAjztTjQbEntity::getJcry, jcAjztTjQbEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjQbEntity.getNd())){
			queryWrapper.eq(JcAjztTjQbEntity::getNd, jcAjztTjQbEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjQbEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjQbEntity::getSwjgDm, jcAjztTjQbEntity.getSwjgDm());
		}
		
		
		
		IPage<JcAjztTjQbEntity> iPage = this.page(page, queryWrapper);
		return iPage;
	}


}